<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<head>
	<sx:head cache="false" />
	<link rel="stylesheet" href="/hrs-intranet/styles/displaytag.css" type="text/css" />
	<link rel="stylesheet" href="/hrs-intranet/styles/errortag.css" type="text/css" />
</head>
<s:actionerror/>
<s:fielderror/>
<div>
<s:if test="(calculated == true) && (calculatedAmount != 0)">
	<div class="oldErrorMsg">
		<h4 class="oldErrorTitle"><s:property value="calculatedAmountText" /></h4>
		<s:url id="viewVacationDays_action" action="VacationDaysAction" method="viewVacationDetails"/>
		<s:a href="%{viewVacationDays_action}" cssClass="rightTimeOff">View Details</s:a>
	</div>
</s:if>
<s:elseif test="(calculated == true) && (calculatedAmount == 0)">
	<div class="oldErrorMsg">
		<h4 class="oldErrorTitle">The system could not find any employee whose vacation period is not yet been calculated.</h4>
	</div>
</s:elseif>
</div>
	
<s:if test="(InVacationDetails == false)">
	<div>
	<display:table name="listModel" excludedParams="*" requestURI="VacationDaysAction_list" class="listable" cellpadding="0" cellspacing="0" pagesize="80">
		<display:column property="calculatedBy.name" sortable="true" title="User"/>
		<display:column property="calculationDate" sortable="true" title="Calculation date" format="{0,date,dd/MM/yyyy hh:mm:ss}" />
	</display:table>
	</div>

	<div>
	<s:if test="hasPermission(permissionNameConverter.getCalculateVacationsPermission())" >
	<s:form> 
		<s:hidden key="calculatedAmountText"/>
		<s:hidden key="calculatedAmount"/>
		<s:hidden key="calculated"/>
		<s:hidden key="InVacationDetails"/>
		<s:submit key="Calculate" action="VacationDaysAction" cssClass="btn" method="calculateVacation" />
	</s:form>
	</s:if>
	</div>
</s:if>
<s:elseif test="(InVacationDetails == true)">
	<div>
	<display:table name="availableLicenseDaysCalculated" excludedParams="*" requestURI="VacationDaysAction_list" class="listable" cellpadding="0" cellspacing="0" pagesize="200">
		<display:column property="employee.person.name" sortable="true" title="Employee"/>
		<display:column property="currentPeriodVacationDays" sortable="true" title="Calculated Vacation Days"/>
	</display:table>
	</div>
</s:elseif>